#coding:utf8
# vim: tabstop=4 shiftwidth=4 softtabstop=4
"""
Created on May 4, 2013

@author: join
"""

from cvirt.manager.monitor.plugins.plugin import MetaPluginSum


class Memory(MetaPluginSum):
    plugin_directory = "memory"
    dst_name = "memory"

    def gen(self):
        graphs = []
        graphs += self.graph_meta("memory-%s.png")
        return graphs

    def graph_meta(self, *args):
        values = (
            ('used', 'ff0000', 'memory-used.rrd', "value"),
            ('buffered', 'ffb000', 'memory-buffered.rrd', "value"),
            ('cached', '0000ff', 'memory-cached.rrd', "value"),
            ('free', '00e000', 'memory-free.rrd', "value"),
        )
        return super(Memory, self).graph_meta(values, *args)